<div class="grid_container">
    <div class="grid_12">
        <?php
        echo $this->Ajax->form(array('type' => 'post',
            'options' => array(
                'model' => 'Seguro',
                'update' => 'cargadatos',
                'id' => 'form103',
                'class' => 'form_container left_label valid_tip',
                'url' => array(
                    'controller' => 'Seguros',
                    'action' => 'ajaxencuentrapacientesseguros'
                ),
            )
        ));
        ?>
        <div class="widget_wrap">
            <div class="widget_top">
                <span class="h_icon list"></span>
                <h6>BUSCAR ATENCIONES DE SEGURO</h6>
            </div>
            <div class="widget_content">
                <ul>
                    <li>
                        <div class="form_grid_12">
                            <label class="field_title">Fechas</label>
                            <div class="form_input">
                                <div class=" form_grid_2 alpha">
                                    <!--<input name="fechadesde" type="text" class="datepicker" value="<?php //echo date('d-m-Y')?>" data-date-format="dd-mm-yyyy"/>-->
                                    <input type="date" name="fechadesde">
                                    <span class=" label_intro">Desde</span>
                                </div>
                                <div class="form_grid_2">
                                    &nbsp;
                                </div>
                                <div class=" form_grid_2">
                                    <!--<input name="fechahasta" type="text" class="datepicker" value="<?php //echo date('d-m-Y')?>" data-date-format="dd-mm-yyyy"/>-->
                                    <input type="date" name="fechahasta">
                                    <span class=" label_intro">Hasta</span>
                                </div>
                                <span class="clear"></span>
                            </div>
                        </div>
                    </li>
                    

                    <li>
                        <div class="form_grid_12">
                            <label class="field_title">Seguro</label>
                            <div class="form_input">
                               <div class="form_grid_6 alpha">
                                        <select data-placeholder="Seleccione el departamento..." class="chzn-select full" name="data[seguro_id]" tabindex="4" id="seguro">
                                            <option value=""></option>
                                            <?php foreach ($seguros as $s): ?>
                                                <option value="<?php echo $s['Seguro']['id'] ?>">
                                                    <?php echo $s['Seguro']['nombre'] ?>
                                                </option>
                                            <?php endforeach; ?>
                                        </select>
                                        <span class=" label_intro">TIPO SEGURO</span>
                                    </div>
                                <div class="form_grid_4" id="colegios" style="display: none">
                                        <select data-placeholder="Seleccione el colegio..." class="chzn-select full" name="data[colegio_id]" tabindex="4">
                                            <option value=""></option>
                                        </select>
                                        <span class=" label_intro">COLEGIO</span>
                                    </div>
                                <span class="clear"></span>
                            </div>
                        </div>
                    </li>

                                                                              
                    <li>
                        <div class="form_grid_12">
                            <div class="form_input">

                                <button type="submit" class="btn_small btn_blue"><span>Buscar </span></button>
                                
                            </div>
                        </div>
                    </li>
                </ul>
                </form>
                <span class="clear"></span>
            </div>
        </div>
    </div>

    <div class="grid_12">
        <div id="cargadatos">
            
        </div>    
    </div>

</div>
<script>
    $(document).ready(function() {
        $('#seguro').change(function() {
            if(this.value == 1){
                
                $('#colegios').load('<?php echo $this->Html->url(array('action' => 'ajaxcolegios')) ?>');
                $('#colegios').show('slow');
                       
            }else{
                $('#colegios').hide('slow');
            }
        });
    });
    
</script>